﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Framework.Data;
using Ue.Infrastructure.EntityFactoryFramework;
using Ue.Qcdz.Domain.ShopArticle;
namespace Ue.Qcdz.Repositories.ShopArticle
{
    public class ShopNewsFactory : IEntityFactory<ShopNews>
    {


        internal class FieldNames : FieldNamesBase
        {
            public const string Title = "Title";
            public const string ShopId = "ShopId";
            public const string Editor = "Editor";
            public const string Remark = "Remark";
            public const string Content = "Content";
            public const string Reference = "Reference";
            public const string DisplayOrder = "DisplayOrder";
            public const string Status = "Status";
        }


        #region IEntityFactory<ShopNews> 成员

        public ShopNews BuildEntity(System.Data.IDataReader reader)
        {
            return new ShopNewsFroxy(
                   reader.Get<Guid>(ShopNewsFactory.FieldNames.EntityKey),
                   reader.Get<string>(ShopNewsFactory.FieldNames.Title),
                   reader.Get<string>(ShopNewsFactory.FieldNames.Editor),
                   reader.Get<string>(ShopNewsFactory.FieldNames.Reference),
                   reader.Get<string>(ShopNewsFactory.FieldNames.Content),
                   reader.Get<string>(ShopNewsFactory.FieldNames.Remark),
                   reader.Get<int>(ShopNewsFactory.FieldNames.DisplayOrder),
                   reader.Get<int>(ShopNewsFactory.FieldNames.Status),
                   reader.Get<DateTime>(ShopNewsFactory.FieldNames.CreateOn)
            );
        }
        #endregion
    }
}
